import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home/list', 
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('../views/HomeView.vue'),
    children:[
      {
        path:'',
        redirect:'list'
      },
      {
        path:'list',
        name:'list',
        component: ()=>import('../views/ListView.vue')
      },
      {
        path:'hot',
        name:'hot',
        component:()=>import('../views/HotView.vue')
      },
      {
        path:'concern',
        name:'concern',
        component: ()=>import('../views/ConcernView.vue'),
      },
      {
        path:'story',
        name:'story',
        component:()=>import('../views/StoryView.vue')
      },
    ]
  },
  {
    path: '/answer',
    name: 'answer',
    component: () => import('../views/AnswerView.vue')
  },
  {
    path: '/information',
    name: 'information',
    component: () => import('../views/InformationView.vue')
  },
  {
    path: '/my',
    name: 'my',
    component: () => import('../views/MyView.vue'),
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/LoginView.vue')
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('../views/RegisterView.vue')
  },
  {
    path: '/detail',
    name: 'detail',
    component: () => import('../views/DetailView.vue')
  },
  {
    path:'/comment',
    name:'comment',
    component:()=>import('../views/CommentView.vue'),
  },
  {
    path:'/search',
    name:'search',
    component:()=>import('../views/SearchView.vue')
  },
  {
    path:'/concerndetali',
    name:'concerndetali',
    component:()=>import('../views/ConcernDetaliView.vue')
  },
  {
    path:'/star',
    name:'star',
    component:()=>import('../views/starView.vue')
  },
  {
    path: '/*',
    name: 'error',
    component: () => import('../views/ErrorVIew.vue')
  },
  
]

const router = new VueRouter({
  routes
})

export default router
